<?php

declare(strict_types=1);

namespace App\Resource\Activity\Carnival\WealthRank;

use Illuminate\Http\Resources\Json\JsonResource;

class Resource extends JsonResource
{
    public function toArray($request): array
    {
        return [
            'sum_price'    => $this->sum_price ?? null,
            'is_show_rank' => $this->is_show_rank ?? null,
            'user_id'      => $this->user_id ?? null,
            'head_picture' => $this->user_data->head_picture ?? null,
            'user_code'    => $this->user_data->user_code ?? null,
            'nickname'     => $this->user_data->nickname ?? null,
        ];
    }
}
